<template>
  <div style="display: flex;flex-direction: column;height: 100%" v-loading="loading">
    <div class="el-header">
      <el-form :inline="true" class="search-form search-form-normal" size="mini" ref="search_keys" :rules="rules"
               :model="search_keys">
        <el-collapse accordion>
          <el-collapse-item>
            <template slot="title">
              <i class="header-icon el-icon-s-operation">{{$t('Tips.allSearchKey')}}</i>
            </template>
            <div>
              <el-form-item :label="$t('pageTable.OrderInfoOrderCode')" v-if="mode != 'merge'">
                <el-input :placeholder="$t('pageTable.OrderInfoOrderCode')" v-model="search_keys.orderCode"
                          class="search-form-item-input"></el-input>
              </el-form-item>
              <el-form-item :label="$t('pageTable.billNo')">
                <el-input :placeholder="$t('pageTable.billNo')" v-model="search_keys.billNo"
                          class="search-form-item-input"></el-input>
              </el-form-item>
              <el-form-item :label="$t('pageTable.TypeOfShipping')">
                <el-select v-model="search_keys.shippingMethods" class="search-form-item-input" size="mini" knx>
                  <el-option value=""></el-option>
                  <el-option
                    size="mini"
                    v-for="item in transportation"
                    :key="item.value"
                    :label="item.name"
                    :value="item.value">
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item :label="$t('pageTable.containerSize')">
                <el-input :placeholder="$t('pageTable.containerSize')" v-model="search_keys.containerSize"
                          class="search-form-item-input"></el-input>
              </el-form-item>

              <el-form-item :label="$t('pageTable.materialName')">
                <el-input :placeholder="$t('pageTable.materialName')" v-model="search_keys.materialName"
                          class="search-form-item-input"></el-input>
              </el-form-item>
              <el-form-item :label="$t('pageTable.MatterSupplierName')">
                <el-input :placeholder="$t('pageTable.MatterSupplierName')" v-model="search_keys.supplierName"
                          class="search-form-item-input"></el-input>
              </el-form-item>


              <el-form-item :label="$t('pageTable.MatterMaterialSpecificNumber')">
                <el-input :placeholder="$t('pageTable.MatterMaterialSpecificNumber')" v-model="search_keys.materialCode"
                          class="search-form-item-input"></el-input>
              </el-form-item>
              <el-form-item :label="$t('pageTable.contractNo')">
                <el-input :placeholder="$t('pageTable.contractNo')" v-model="search_keys.contractNo"
                          class="search-form-item-input"></el-input>
              </el-form-item>
              <el-form-item :label="$t('pageTable.goodsStatus')">
                <el-select v-model="search_keys.state" multiple class="search-form-item-input" size="mini" knx>
                  <el-option
                    size="mini"
                    v-for="item in goodsStatus"
                    :key="item.value"
                    :label="item.name"
                    :value="item.value">
                  </el-option>
                </el-select>
              </el-form-item>
              <!--<el-form-item label="库存数量">-->
              <!--<el-input placeholder="HS海关编码" v-model="search_keys.stockAmount" class="search-form-item-input"></el-input>-->
              <!--</el-form-item>-->
              <el-form-item :label="$t('pageTable.packingDate')">
                <el-date-picker
                  class=""
                  v-model="search_keys.packingDateArray"
                  type="daterange"
                  value-format="yyyyMMddHHmmss"
                  :start-placeholder="$t('pageTable.startTime')"
                  :end-placeholder="$t('pageTable.endTime')">
                </el-date-picker>
              </el-form-item>
              <el-form-item :label="$t('pageTable.departureDate')">
                <el-date-picker
                  class=""
                  v-model="search_keys.departureDateArray"
                  type="daterange"
                  value-format="yyyyMMddHHmmss"
                  :start-placeholder="$t('pageTable.startTime')"
                  :end-placeholder="$t('pageTable.endTime')">
                </el-date-picker>
              </el-form-item>
              <el-form-item :label="$t('pageTable.createUser')">
                <el-input :placeholder="$t('pageTable.createUser')" v-model="search_keys.createUser"
                          class="search-form-item-input"></el-input>
              </el-form-item>
              <el-form-item :label="$t('pageTable.createTime')">
                <el-date-picker
                  class=""
                  v-model="search_keys.createTimeArray"
                  type="daterange"
                  value-format="yyyyMMddHHmmss"
                  :start-placeholder="$t('pageTable.startTime')"
                  :end-placeholder="$t('pageTable.endTime')">
                </el-date-picker>
                <!--<el-input placeholder="创建时间" v-model="search_keys.createTime" class="search-form-item-input"></el-input>-->
              </el-form-item>
              <el-form-item :label="$t('pageTable.updateUser')">
                <el-input :placeholder="$t('pageTable.updateUser')" v-model="search_keys.updateUser"
                          class="search-form-item-input"></el-input>
              </el-form-item>
              <el-form-item :label="$t('pageTable.updateTime')">
                <el-date-picker
                  class=""
                  v-model="search_keys.updateTimeArray"
                  type="daterange"
                  value-format="yyyyMMddHHmmss"
                  :start-placeholder="$t('pageTable.startTime')"
                  :end-placeholder="$t('pageTable.endTime')">
                </el-date-picker>
              </el-form-item>
              <el-form-item :label="$t('pageTable.containerNo')" prop="containerNo">
                <el-input
                  type="textarea"
                  :rows="2"
                  :placeholder="$t('pageTable.containerNo')" v-model="search_keys.containerNo"
                  class="search-form-item-input"></el-input>
              </el-form-item>
            </div>
          </el-collapse-item>
        </el-collapse>
        <!--<el-form-item style="float: right">-->
        <!--<el-button type="primary" v-if="subject.hasPermissions('*')" @click="exportData(old_search_keys)" size="mini" >-->
        <!--<i class="fa fa-plus" aria-hidden="true"></i> 导出-->
        <!--</el-button>-->
        <!--</el-form-item>-->
        <el-form-item style="float: right">
          <el-button type="primary" v-if="subject.hasPermissions('maintenance:warehouse:goods:list:view')"
                     @click="exec_search({search_keys, pageNum:1})">
            <i class="fa fa-search" aria-hidden="true"></i> {{$t('searchFrom.search')}}
          </el-button>
        </el-form-item>
        <el-form-item style="float: right">
          <el-button type="primary" @click="reset" icon="el-icon-error">
            {{$t('searchFrom.reset')}}
          </el-button>
        </el-form-item>
        <el-form-item style="float: right">
          <el-button type="primary" v-if="subject.hasPermissions('maintenance:warehouse:goods:list:delete')&& mode=='merge'"
                     :disabled="multipleSelection.length==0" @click="deleteGoods" icon="el-icon-delete">
            {{$t('searchFrom.delete')}}
          </el-button>
        </el-form-item>
        <el-form-item style="float: right">
          <el-button type="primary" v-if="subject.hasPermissions('maintenance:warehouse:goods:list:add') && mode=='merge'" @click="add()"
                     icon="el-icon-plus">
            {{$t('searchFrom.add')}}
          </el-button>
        </el-form-item>
        <el-form-item style="float: right">
          <el-button type="primary" v-if="subject.hasPermissions('maintenance:warehouse:order:info:export')"
                     @click="exportData(search_keys)" size="mini">
            <i class="fa fa-plus" aria-hidden="true"></i> {{$t('searchFrom.export')}}
          </el-button>
        </el-form-item>
        <el-form-item style="float: right">
          <el-button type="primary" v-if="subject.hasPermissions('maintenance:warehouse:goods:list:receive')&& mode=='merge'"
                     :disabled="multipleSelection.length==0" @click="receivingGoods" icon="el-icon-delete">
            {{$t('pageTable.receivingGoods')}}
          </el-button>
          <!--searchFrom.ConfirmationOfReceipt   receivingGoods-->
        </el-form-item>
        <el-form-item style="float: right">
          <el-button type="primary" v-if="subject.hasPermissions('maintenance:warehouse:goods:list:send')&& mode=='merge'"
                     :disabled="multipleSelection.length==0" @click="sendGoods" icon="el-icon-delete">
            {{$t('pageTable.deliverGoods')}}
          </el-button>
          <!--searchFrom.ConfirmationOfReceipt   receivingGoods-->
        </el-form-item>


      </el-form>
    </div>

    <el-table size="mini"
              style="flex: 1"
              :height="600"
              ref="tb"
              border
              class="search-result-table"
              :data="search_result.list" row-key="id"
              :stripe="true"
              :row-class-name="({row,rowIndex}) => { return row.state==1 ? 'locked-row' : null; }"
              @row-click="clickRow"
              @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" key="1" v-if="mode == 'merge'" fixed width="50"/>
      <el-table-column prop="orderCode" key="2"  width="100" align="center" v-if="mode!='merge'" :label="$t('pageTable.OrderInfoOrderCode')"  />
      <!--            <el-table-column prop="orderCode"  width="100" align="center" label="订单产品型号"/>-->
      <!--            <el-table-column prop="orderDetailInfo.orderCodeDesc"  width="100" align="center" label="订单产品型号描述"  />-->
      <el-table-column prop="contractNo" key="3" width="130" :show-overflow-tooltip="true" align="center"
                       :label="$t('pageTable.contractNo')"/>
      <el-table-column width="100" key="4" align="center" :label="$t('pageTable.packingDate')">
        <template slot-scope="scope">
          {{scope.row.packingDate != null ?$moment(scope.row.packingDate,'YYYYMMDD').format('YYYY-MM-DD') : ''}}
        </template>
      </el-table-column>
      <el-table-column width="100" key="5" align="center" :label="$t('pageTable.departureDate')">
        <template slot-scope="scope">
          {{scope.row.departureDate != null ?$moment(scope.row.departureDate,'YYYYMMDD').format('YYYY-MM-DD') : ''}}
        </template>
      </el-table-column>
      <el-table-column key="6" prop="materialCode" :show-overflow-tooltip="true" width="120" align="center"
                       :label="$t('pageTable.MatterMaterialSpecificNumber')"/>
      <el-table-column key="7" prop="dictShippingMethods.name" width="100" align="center"
                       :label="$t('pageTable.TypeOfShipping')"/>
      <el-table-column key="8" prop="billNo" :show-overflow-tooltip="true" align="center" :label="$t('pageTable.billNo')"/>
      <el-table-column key="9" prop="containerSize" width="100" align="center" :label="$t('pageTable.containerSize')"/>
      <el-table-column key="10" prop="containerNo" width="120" align="center" :label="$t('pageTable.containerNo')"/>
      <el-table-column key="11" prop="supplierName" width="130" :show-overflow-tooltip="true" align="center"
                       :label="$t('pageTable.MatterSupplierName')"/>
      <el-table-column key="12" prop="materialName" :show-overflow-tooltip="true" align="center"
                       :label="$t('pageTable.materialName')"/>
      <el-table-column key="13"prop="dictUnit.name" :show-overflow-tooltip="true" align="center"
                       :label="$t('pageTable.MatterCompany')"/>
      <el-table-column key="14" prop="sendAmount" :show-overflow-tooltip="true" align="center"
                       :label="$t('pageTable.sendAmount')"/>
      <el-table-column key="15" prop="price" :show-overflow-tooltip="true" align="center" :label="$t('pageTable.price')"/>
      <el-table-column key="16" prop="amount" :show-overflow-tooltip="true" align="center" :label="$t('pageTable.amount')"/>
      <el-table-column key="17" prop="dictPayment.name" :show-overflow-tooltip="true" align="center"
                       :label="$t('pageTable.payment')"/>
      <el-table-column key="18" width="100" align="center" :label="$t('pageTable.paymentDay')">
        <template slot-scope="scope">
          {{scope.row.paymentDay != null ?$moment(scope.row.paymentDay,'YYYYMMDD').format('YYYY-MM-DD') : ''}}
        </template>
      </el-table-column>
      <el-table-column key="19" width="100" align="center" :label="$t('pageTable.paymentDate')">
        <template slot-scope="scope">
          {{scope.row.paymentDate != null ?$moment(scope.row.paymentDate,'YYYYMMDD').format('YYYY-MM-DD') : ''}}
        </template>
      </el-table-column>
      <el-table-column key="20" prop="remark" :show-overflow-tooltip="true" align="center"
                       :label="$t('pageTable.dictionaryRemark')"/>
      <el-table-column key="21" prop="freightPremium" width="120" :show-overflow-tooltip="true" align="center"
                       :label="$t('pageTable.freightPremium')"/>
      <el-table-column key="22" prop="createUser" align="center" :label="$t('pageTable.createUser')"/>
      <el-table-column key="23" :label="$t('pageTable.createTime')" show-overflow-tooltip width="120">
        <template slot-scope="scope">
          {{scope.row.createTime != null ?$moment(scope.row.createTime,'YYYYMMDDHHmmss').format('YYYY-MM-DD h:mm:ss a')
          : ''}}
        </template>
      </el-table-column>
      <el-table-column key="24" prop="updateUser" width="100" align="center" :label="$t('pageTable.updateUser')"/>
      <el-table-column key="25" :label="$t('pageTable.updateTime')" show-overflow-tooltip width="120">
        <template slot-scope="scope">
          {{scope.row.updateTime != null ?$moment(scope.row.updateTime,'YYYYMMDDHHmmss').format('YYYY-MM-DD h:mm:ss a')
          : ''}}
        </template>
      </el-table-column>
      <el-table-column key="26" v-if="mode=='merge'" fixed="right" prop="dictStatus.name" width="80" :label="$t('pageTable.goodsStatus')"/>


      <el-table-column key="27" fixed="right" width="200" :label="$t('pageTable.operate')" v-if="mode=='merge'">
        <template slot-scope="scope">
          <el-button v-if="subject.hasPermissions('maintenance:warehouse:goods:list:edit')&& mode=='merge'" type="primary" size="mini"
                     class="btn-opt" plain @click="splitInfo(scope.row.id)">
            <i class="el-icon-folder-add"></i></el-button>
          <el-button v-if="subject.hasPermissions('maintenance:warehouse:goods:list:edit')&& mode=='merge'" type="primary" size="mini"
                     class="btn-opt" plain @click="edit(scope.row.id)">
            <i class="el-icon-news"></i></el-button>
        </template>
      </el-table-column>
    </el-table>
    <edit-goods v-bind.sync="link_modal_state" @success="exec_search({search_keys, pageNum:1})"
                v-if="link_modal_state.activated"></edit-goods>
    <split-info v-bind.sync="link_modal_state_split" @success="exec_search({search_keys, pageNum:1})"
                v-if="link_modal_state_split.activated"></split-info>

    <!--分页-->
    <div style="text-align: center">
      <el-pagination @current-change="exec_search({pageNum:$event})"
                     @size-change="exec_search({search_keys,pageSize:$event})"
                     :total="search_result.total"
                     :current-page="search_result.pageNum"
                     :page-size="search_result.pageSize"
                     :disabled="!search_result.total"
                     :page-sizes="PAGE_SIZES"
                     layout="total, sizes, prev, pager, next, jumper"
                     background/>
    </div>
  </div>
</template>

<script>
  import activityService from '@/api/warehouse/GoodsList'
  import ui_config from '@/config/ui_config'
  import ImportButton from '@/components/data-import/ImportButton'
  import {downloadBlobResponse} from '@/utils/request_utils'
  import {mapGetters, mapState} from 'vuex'
  import EditGoods from './EditGoods'
  import splitInfo from './splitInfo'


  export default {
    data() {
      return {
        loading: false,
        PAGE_SIZES: ui_config.PAGE_SIZES,
        link_modal_state: {},
        link_modal_state_split: {},
        //单位下拉框数据
        is_searching: true,
        rules: {
          containerNo: [
            {pattern: /^[a-zA-Z0-9\,]+$/, trigger: 'blur', message: this.$t('Tips.floatCheck'),}
          ],
        },
        goodsStatus: [],
        transportation: [],
        materialCategorys: [],
        old_search_keys: {},
        search_keys: {
          orderCode:"",
          materialCode: '',
          contractNo: "",
          packingDateArray: "",
          departureDateArray: "",
          billNo: "",
          shippingMethods: "",
          containerSize: "",
          containerNo: "",
          materialName: "",
          supplierName: "",
          createUser: '',
          createTime: '',
          createTimeArray: '',
          updateUser: '',
          updateTimeArray: '',
          updateTime: '',
          state: [],

        },
        search_keys_snap: null,
        search_result: {},
        multipleSelection: [],
        idsStr: [],
        mode: "",
      };
    },
    components: {ImportButton, EditGoods, splitInfo},
    async mounted() {
      this.mode = this.$route.meta.mode;
      await this.init();
      this.exec_search({search_keys: this.search_keys, pageNum: 1});
    },
    computed: {
      ...mapState({
        language: state => state.app.language
      }),
    },
    watch: {
      async language(val, val1) {
        // alert(val+val1)
        await this.init();
        this.exec_search({search_keys: this.search_keys, pageNum: 1});
      }
    },
    methods: {
      //添加
      add() {
        this.link_modal_state = {activated: true, mode: "ADD",};
      },
      //编辑
      edit(id) {
        this.link_modal_state = {activated: true, id, mode: "EDIT",};
      },
      //拆分
      splitInfo(id) {
        this.link_modal_state_split = {activated: true, id};
      },
      reset() {
        this.search_keys = {
          orderCode:"",
          materialCode: '',
          contractNo: "",
          packingDateArray: "",
          departureDateArray: "",
          billNo: "",
          shippingMethods: "",
          containerSize: "",
          containerNo: "",
          materialName: "",
          supplierName: "",
          createUser: '',
          createTime: '',
          createTimeArray: '',
          updateUser: '',
          updateTimeArray: '',
          updateTime: '',
          state: [],
        }
      },
      price(row, column, cellValue, index) {
        if (cellValue) {
          return cellValue.toFixed(2)
        } else {
          return ""
        }
      },
      init() {
        return activityService.initView().then(resp => {
          this.goodsStatus = resp.data.result.goodsStatus;
          this.transportation = resp.data.result.transportation
        }, error => {

        })
      },
      clickRow(row) {
        this.$refs.tb.toggleRowSelection(row);
      },
      exec_search({
                    search_keys = JSON.parse(this.search_keys_snap),
                    pageNum = this.search_result.pageNum,
                    pageSize = this.search_result.pageSize,
                  }) {
        let search_keys_snap = JSON.stringify(search_keys);     //抓查询条件快照
        let containerNo;
        if (this.search_keys.containerNo != null && this.search_keys.containerNo != '') {
          let a = this.search_keys.containerNo.trim()
          if (a.charAt(a.length - 1) == ',') {
            a.substring(0, a.length - 1)
          }
          containerNo = "'" + a.replace(/,/g, "','") + "'";
        } else {
          containerNo = this.search_keys.containerNo
        }


        let data = {
          ...search_keys,
          containerNo: containerNo,
          stateArray: search_keys.state && search_keys.state || "",
          packingDateStart: search_keys.packingDateArray && search_keys.packingDateArray[0] || "",
          packingDateEnd: search_keys.packingDateArray && search_keys.packingDateArray[1] || "",
          // packingDateEnd     :   search_keys.packingDateArray && this.$moment(search_keys.packingDateArray[1],'YYYYMMDDHHmmss').add(1, 'days').format('YYYYMMDDHHmmss')|| "",
          departureDateStart: search_keys.departureDateArray && search_keys.departureDateArray[0] || "",
          departureDateEnd: search_keys.departureDateArray && search_keys.departureDateArray[1] || "",
          // departureDateEnd     :   search_keys.departureDateArray && this.$moment(search_keys.departureDateArray[1],'YYYYMMDDHHmmss').add(1, 'days').format('YYYYMMDDHHmmss') || "",
          createTimeStart: search_keys.createTimeArray && search_keys.createTimeArray[0] || "",
          createTimeEnd: search_keys.createTimeArray && search_keys.createTimeArray[1] || "",
          // createTimeEnd       :   search_keys.createTimeArray && this.$moment(search_keys.createTimeArray[1],'YYYYMMDDHHmmss').add(1, 'days').format('YYYYMMDDHHmmss')    || "",
          updateTimeStart: search_keys.updateTimeArray && search_keys.updateTimeArray[0] || "",
          updateTimeEnd: search_keys.updateTimeArray && search_keys.updateTimeArray[1] || "",
          // updateTimeEnd       :   search_keys.updateTimeArray && this.$moment(search_keys.updateTimeArray[1],'YYYYMMDDHHmmss').add(1, 'days').format('YYYYMMDDHHmmss')    || "",
        };
        this.loading = true;
        if (this.mode == "merge"){
          activityService.findGoodsList({...data, pageNum, pageSize}).then(resp => {
            this.search_result = resp.data.resultInfo;                //视图展示查询结果
            this.old_search_keys = JSON.stringify(data);
            this.search_keys = JSON.parse(search_keys_snap); //还原查询条件
            this.search_keys_snap = search_keys_snap;             //存储查询条件快照
            this.loading = false;
          }, err => {
            console.error(err);
          })
        } else {
          activityService.findGoodsListSplit({...data, pageNum, pageSize}).then(resp => {
            this.search_result = resp.data.resultInfo;                //视图展示查询结果
            this.old_search_keys = JSON.stringify(data);
            this.search_keys = JSON.parse(search_keys_snap); //还原查询条件
            this.search_keys_snap = search_keys_snap;             //存储查询条件快照
            this.loading = false;
          }, err => {
            console.error(err);
          })
        }

      },
      handleSelectionChange(val) {
        this.multipleSelection = val;
      },
      sendGoods() {
        this.$confirm(this.$t('Tips.AreShipmentsConfirmed'), this.$t('Tips.tips'), {
          confirmButtonText: this.$t('Tips.yes'),
          cancelButtonText: this.$t('Tips.no'),
          type: 'warning',
          center: true
        }).then(() => {
            this.idsStr = [];
            this.multipleSelection.forEach(item => {
              this.idsStr.push(item.id)
            });
            this.loading = true;
            activityService.sendGoods({idsStr: this.idsStr}).then(resp => {
              if (resp.data.code == "201") {
                this.$notify({message: resp.data.message, type: "success"});
                this.exec_search({search_keys: this.search_keys, pageNum: 1})
              } else {
                this.$notify({message: resp.data.message, type: "error"});
              }
              this.loading = false;
            })
          }
        ).catch(() => {
          this.internal_activated = true;
        })//删除
      },
      exportData(search_keys) {
        this.$confirm(this.$t("Tips.exportQueries"), this.$t("Tips.tips"), {
          confirmButtonText: this.$t("Tips.yes"),
          cancelButtonText: this.$t("Tips.no"),
          type: 'info',
          center: true
        }).then(() => {
          // debugger
          this.loading = true;
          // let data=JSON.parse(this.old_search_keys);
          let data = {
            ...search_keys,
            departureDateStart: search_keys.departureDateArray && search_keys.departureDateArray[0] || "",
            departureDateEnd: search_keys.departureDateArray && search_keys.departureDateArray[1] || "",
          };
          if (this.mode == 'merge'){
            activityService.exportData({...data}).then(resp => {
              downloadBlobResponse(resp); // 文件下载
              this.loading = false;
            });
          } else {
            //TODO 这里要写新的 导出方法
            activityService.exportData({...data}).then(resp => {
              downloadBlobResponse(resp); // 文件下载
              this.loading = false;
            });
          }

        }).catch(() => {
          this.internal_activated = true;
        })//删除
      },
      receivingGoods() {
        this.$confirm(this.$t('Tips.ConfirmationOfReceipt'), this.$t('Tips.tips'), {
          confirmButtonText: this.$t('Tips.yes'),
          cancelButtonText: this.$t('Tips.no'),
          type: 'warning',
          center: true
        }).then(() => {
            this.idsStr = [];
            this.multipleSelection.forEach(item => {
              this.idsStr.push(item.id)
            });
            this.loading = true;
            activityService.receivingGoods({idsStr: this.idsStr}).then(resp => {
              if (resp.data.code == "201") {
                this.$notify({message: resp.data.message, type: "success"});
                this.exec_search({search_keys: this.search_keys, pageNum: 1})
              } else {
                this.$notify({message: resp.data.message, type: "error"});
              }
              this.loading = false;
            })
          }
        ).catch(() => {
          this.internal_activated = true;
        })//删除
      },
      //删除
      deleteGoods() {
        this.$confirm(this.$t("Tips.deleteQueries"), this.$t("Tips.tips"), {
          confirmButtonText: this.$t("Tips.yes"),
          cancelButtonText: this.$t("Tips.no"),
          type: 'warning',
          center: true
        }).then(() => {
            this.idsStr = [];
            this.multipleSelection.forEach(item => {
              this.idsStr.push(item.id)
            });
            activityService.deleteByIds({idsStr: this.idsStr}).then(resp => {
              if (resp.data.code == "201") {
                this.$notify({message: resp.data.message, type: "success"});
                this.exec_search({search_keys: this.search_keys, pageNum: 1})
              } else {
                this.$notify({message: resp.data.message, type: "error"});
              }
            })
          }
        ).catch(() => {
          this.internal_activated = true;
        })
      },
    },
  }
</script>

<style scoped>
  .search-result-table >>> .el-table__body-wrapper::-webkit-scrollbar {
    width: 10px;
    height: 15px;
  }

  .search-result-table >>> .el-table__body-wrapper::-webkit-scrollbar-thumb {
    background-color: #a1a3a9;
    border-radius: 3px;
  }


</style>
